<template>
	<view>
		<ym-navbar :immersive="true" title="优惠券" :scrollTop="scrollTop"></ym-navbar>
		<view class="header">
			<image class="bg1" src="../static/wxImage/bg-shareCup.png" mode="widthFix"></image>
			<image class="bg2" src="../static/wxImage/text-sss.png" mode="widthFix"></image>
		</view>
		<view class="body">
			<view class="label u-f-ajc">优惠券</view>
			<view class="coupon-wrap">
				<view class="coupon" v-for="item in 10">
					<image class="coupon-bg" src="../static/wxImage/bg-coupon3.png" mode="widthFix"></image>
					<view class="content">
						<view class="content-l u-f-ajc">
							<text>12</text>
							<text>元</text>
						</view>
						<view class="content-r">
							<view class="content-r-r">
								<view>溢通环保运营商</view>
								<view>
									加注满
									<text style="color: #FFE165;font-size: 32rpx;">100</text>
									可用
								</view>
								<view class="time">2019.11.09-2019.11.21</view>
							</view>
							<view class="content-r-l">
								<button type="default">立即领取</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import ymNavbar from '@/components/ym-navbar/ym-navbar.vue';
export default {
	components: { ymNavbar },
	data() {
		return {
			scrollTop:0,
			couponInfo:'' // 优惠券信息
		};
	},
	onLoad() {
		this.couponInfo = this.$store.state.tmpData;
		this.$store.commit('setTmpData','');
	},
	onPageScroll(e) {
		this.scrollTop = e.scrollTop;
	}
};
</script>

<style lang="scss">
page {
	background-color: #5555f1;
}



.header {
	position: relative;
	.bg1 {
		width: 100vw;
	}

	.bg2 {
		position: absolute;
		top: 213rpx;
		z-index: 100;
		width: 574rpx;
		left: 100rpx;
		height: 70rpx;
	}
	.text {
		position: absolute;
		color: #ffffff;
		border: 1rpx solid #ffffff;
		left: 50%;
		top: 320rpx;
		transform: translateX(-50%);
		border-radius: 60rpx;
		width: 390rpx;
		height: 60rpx;
		line-height: 58rpx;
		text-align: center;
	}
}
.body {
	
	.label {
		color: #ffe165;
		font-size: 30rpx;
		font-weight: bold;
		position: relative;

		&::before {
			content: '';
			position: absolute;
			top: 50%;
			left: 150rpx;
			transform: translateY(-50%);
			background: url(../static/wxImage/icon-line.png);
			background-repeat: no-repeat;
			background-size: 122rpx 22rpx;
			z-index: 100;
			width: 122rpx;
			height: 22rpx;
		}

		&::after {
			content: '';
			position: absolute;
			top: 50%;
			right: 150rpx;
			background: url(../static/wxImage/icon-line.png);
			background-repeat: no-repeat;
			background-size: 122rpx 22rpx;
			z-index: 100;
			width: 122rpx;
			height: 22rpx;
			transform: translateY(-50%) rotateZ(180deg);
		}
	}

	.coupon-wrap {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-top: 60rpx;

		.coupon {
			width: 690rpx;
			position: relative;
			height: 180rpx;
			margin-bottom: 30rpx;
			
			.coupon-bg {
				width: 690rpx;
				position: absolute;
			}
			.content {
				position: absolute;
				z-index: 100;
				width: 690rpx;
				height: 180rpx;
				display: flex;
				flex-direction: row;

				.content-l {
					width: 220rpx;
					font-size: 90rpx;
					color: #5657f0;
					display: flex;
					font-weight: bold;

					text {
						position: relative;
						background-image: -webkit-linear-gradient(bottom, #5657F0, #8C90FF);
						-webkit-background-clip: text;
						-webkit-text-fill-color: transparent;
					}
					> text:nth-child(2) {
						font-size: 46rpx;
						position: relative;
						bottom: -10rpx;
					}
				}
				.content-r {
					display: flex;
					flex: 1;
					overflow: hidden;
					padding-left: 74rpx;

					.content-r-r,.content-r-l{
						display: flex;
						flex-direction: column;
						justify-content: center;
						align-content: center;
					}
					.content-r-r {
						width: 240rpx;
					}
					.content-r-l {
						flex: 1;
						overflow: hidden;
						text-align: center;
						>button {
							width: 140rpx;
							height: 60rpx;
							background-color: #FFE164;
							border-radius: 30rpx;
							font-size: 24rpx;
							color: #905815;
							line-height: 60rpx; 
							text-align: center;
						}
					}
					view {
						color: #ffffff;
					}

					.time {
						font-size: 22rpx;
					}
				}
			}
		}
	}

}

.tips {
	margin: 46rpx;

	view {
		color: rgba(255, 255, 255, 0.6);
	}
	> view:nth-child(1) {
		margin: 20rpx 0;
	}
}
</style>
